﻿using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace HML.Design
{
    /// <summary>
    /// VHalvingLine控件设计模式行为
    /// </summary>
    public class VHalvingLineDesigner : ControlDesigner
    {
        public override SelectionRules SelectionRules
        {
            get
            {
                return base.SelectionRules & ~(SelectionRules.LeftSizeable | SelectionRules.RightSizeable);
            }
        }

        public override void InitializeNewComponent(IDictionary defaultValues)
        {
            base.InitializeNewComponent(defaultValues);

            VHalvingLine halvingLine = (VHalvingLine)this.Control;
            MemberDescriptor member = (MemberDescriptor)TypeDescriptor.GetProperties((object)this.Component)["Text"];
            this.RaiseComponentChanging(member);
            halvingLine.Text = "分割线";
            this.RaiseComponentChanged(member, (object)null, (object)null);
        }

    }
}
